home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / rkpls301.zip / RKPDEMO.ZIP / BRAND.PAS next >
Pascal/Delphi Source File  |  1993-03-04  |  2KB  |  67 lines

  1. Program Brand;
  2.  
  3. {
  4.  This is a sample program using RkPlus.  It is a sample of a software
  5.  branding programme that would be used by the user to enter their name
  6.  and registration key and modify the EXE file.  This sample will brand
  7.  the Sample4 programme, using a registration key which would be generated
  8.  by the programmer using the GenKey program.
  9.  
  10.  Brand uses the sample encoding unit Encode.
  11. }
  12.  
  13.  
  14. Uses
  15.   Crt,
  16.   RkPlus,
  17.   Encode;
  18.  
  19.  
  20. Const
  21.   MonthNames : Array[1..12] of String[3]
  22.   = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  23.  
  24.  
  25. Var
  26.   kc    : Char;
  27.  
  28.  
  29. Begin
  30.   SetProgID('Sample');
  31.   SetKeyFile('Sample4');
  32.   WriteLn('Brand');
  33.   WriteLn('Software Branding Programme for Sample4');
  34.   WriteLn('See RKPLUS.DOC for more info');
  35.   WriteLn;
  36.   Write('Enter name of person to register : ');
  37.   ReadLn(Rkp.Name1);
  38.   WriteLn;
  39.   Write('Enter the registration key : ');
  40.   ReadLn(Rkp.Key);
  41.   WriteLn;
  42.   Rkp.ID := '(c) Serious Cybernetics';
  43.   Rkp.Message := 'Brand';
  44.   Rkp.Name2 := '';
  45.   Rkp.Name3 := '';
  46.   Rkp.Level := 0;
  47.   VerifyKey;
  48.   If Not Rkp.Registered then Begin
  49.     Rkp.Level := 1;
  50.     VerifyKey;
  51.   End;
  52.   If Not Rkp.Registered then
  53.     WriteLn('Invalid key!')
  54.   Else Begin
  55.     Write('Branding ',ExeFileName,'...');
  56.     BrandRegInfo;
  57.     WriteLn;
  58.     WriteLn;
  59.     If RkpOK then
  60.       WriteLn(ExeFileName,' branded.')
  61.     Else If (RkpError = InvalidFile) then
  62.       WriteLn(ExeFileName,' is not a valid RkPlus file!')
  63.     Else
  64.       WriteLn('Error ',RkpError,' branding ',ExeFileName,'.');
  65.   End;
  66. End.
  67.